<!--sidebar-menu-->
<div id="sidebar" class="clearfix"><!-- <a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a> -->
  <ul style="display: block;">
  {% include "common/menu.html" %}
  </ul>
</div>
<!--end sidebar-menu-->

<div id="content">
  
    <div class="container-fluid" style="padding: 0;">

      <div class="widget-box tab-tabs" >
          <div class="widget-title">
              <ul class="nav nav-tabs">
                  {% include "common/tab.html" %}
              </ul>
          </div>
          <div class="widget-content tab-content">
            <div id="tab1" class="tab-pane active">
              <div class="container-fluid">
                  <div class="row-fluid" style="margin: 20px 0;overflow: hidden;">
                   </div>
                  <div class="row-fluid">
                    <div class="content-box content-box-padding" >
                      <p style="font-size:20px;">给用户发放/撤销徽章:</p>
                      <form action='' method='post'>
                          <span style="width:80px;display:inline-block;text-align:right;font-size:14px;">用户uid：</span><input type="text" id ="uid" style="font-size:14px;">
                          <!-- <input size=2 type="hidden" id ="itemId" value="16"> -->
                          <br/><span style="width:80px;display:inline-block;text-align:right;font-size:14px;">类型：</span><select id="itemId" style="width: 100px;">
                            <option value="6,7" selected = "selected" >充值徽章</option>
                            <option value="24" >很行徽章</option>
                            <option value="16" >91荣耀徽章</option>
                            <!-- <option value="6">万贯徽章</option>
                            <option value="7">富甲徽章</option> -->
                          </select>
                          <br/><span style="width:80px;display:inline-block;text-align:right;font-size:14px;">天数：</span><input style="font-size:14px;" type="text" id="day" value="0">
                          <br/><span style="font-size:14px;">天数：0-代表永久，n-天数</span>
                          <br/><br/>
                          <button type="button" class="" style="" onclick="sendItemSubmit()">确定</button>
                          <button type="button" class="" style="" onclick="cancelItemSubmit()">撤销</button>
                      </form>             
                    </div>                  
                  </div>
                </div>
            </div>
            
         </div>
        </div>
    
    </div>
            
    
</div>

<script type="text/javascript">
function sendItemSubmit(){
         var data={};
         data.uid = $('#uid').val();
         data.itemId = $('#itemId').val();
         data.day = $('#day').val();
         data.type = 1;
        $.ajax({
            type:"POST",
            data:data,
            url:'',
            dataType:'json',
            success:function(res){
                if(res.code == 0) {
                    alert('操作成功');
                    location.reload();
                }else{
                     alert(res.info);
                }
            }
       });
 
}

function cancelItemSubmit(){
         var data={};
         data.uid = $('#uid').val();
         data.itemId = $('#itemId').val();
         data.day = $('#day').val();
         data.type = 2;
        $.ajax({
            type:"POST",
            data:data,
            url:'',
            dataType:'json',
            success:function(res){
                if(res.code == 0) {
                    alert('操作成功');
                    location.reload();
                }else{
                     alert(res.info);
                }
            }
       });
 
}
</script>